package com.rany.day01;

public class DemoMethod {
    public static void main(String[] args) {
        int[] arr = {1,2,4,6};
        System.out.println(getMax(arr));
    }
    public static int getMax(int[] arr){
        int max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (max < arr[i]){
                max = arr[i];
            }
        }
       return max;
    }
}
